#! /bin/bash

# You've got to be root to do this -
# it depends on the eee_tarball being located in /root/

setup=${1:-/root/eee-setup}

moddir=/lib/modules/`uname -r`/kernel/drivers/net/ath
mkdir -p ${moddir}
cp ${setup}/ath/*.ko ${moddir}/

# Now add this as an alias to /etc/modprobe.conf
#    ... add to the file alias eth0 atl2 
mp=/etc/modprobe.conf
echo "#" >> ${mp}
echo "# Added for EeeDora setup : ath" >> ${mp}
echo "alias wifi0 ath_pci" >> ${mp}
echo "alias ath0 ath_pci" >> ${mp}
echo "options ath_pci autocreate=sta" >> ${mp}
echo "# Added after ath setup " >> ${mp}
echo "#" >> ${mp}

/sbin/depmod -ae

# Do this as a force since the mirror repo in the ks 
# may have a slightly dated kernel (no big deal)
/sbin/modprobe -f ath_pci
